<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <title>圣诞抽奖--很遗憾</title>
    <link rel="stylesheet" href="css/main.css">
   <style>
	   .weizj {
		   position: absolute;
		   top: 0;
		   left: 0;
		   width: 100%;
		   height: 100%;
		   z-index: 1001;
		   display: none;

	   }
	   .getallprize {
		   position: absolute;
		   top: 0;
		   left: 0;
		   width: 100%;
		   height: 100%;
		   display: none;
		   z-index: 1000;

	   }


	   .share {
		   line-height: 40px;
		   font-size: 28px;
		   color: #fff;
		   font-family: 微软雅黑;
		   padding-top: 23px;

		   position: absolute;
		   bottom: 10%;
		   left: 20%;
		   width: 60%;

	   }

	   input {
		   width: 60%;
		   margin-left: 20%;
		   margin-top: 92%;
		   border: 1px solid red;
		   height: 35px;
		   font-size: 20px;
	   }

	   .shareGuide {
		   position: absolute;
		   width: 100%;
		   height: 100%;
		   z-index: 1111;
		   display: none;

	   }

	   .shareGuide img {
		   width: 100%;
		   height: 100%;
	   }


   </style>


</head>
<body>


<div class="shareGuide"><img src="img/7/share_guide.png"></div>

<!--//失败分享-->
	<div class="weizj">
		<div class="yihan">
			<img src="img/4/yihan.png">
		</div>
		<p class="myscore">
			 太可惜了! 别忘了将藏好礼物的圣诞袜子分享给好友去猜测!让好友帮你赢取流量!
		</p>
		<div class="share">
			<p>分享礼物</p>
		</div>
	</div>


	<!--中奖领取流量-->
	<div class="getallprize">
		<div class="qz">
			<img src="img/3/banner@2x.png">
		</div>
		<div class="banner">
			<img src="img/3/all@2x.png">
		</div>
		<p class="wz">
			赶紧前去兑换流量大礼吧别忘了将藏好礼物的圣诞袜子分享给好友去猜测
		</p>
		<h3>我要兑奖</h3>
		<div class="shurukuang">
			<input id="phoneNum" type="text" value=""/>
		</div>
		<div class="myenter">
		</div>
		<div class="share">
			<p style="margin-left: 0">分享礼物</p>
		</div>
	</div>
	<!--<script src="js/jquery-2.1.4.min.js"></script>-->
<script type="text/javascript" src="js/zepto.min.js"></script>
</body>


<script>

    $(document).ready(function() {

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)return unescape(r[2]);
            return null;
        }



        //成功投中,,,领取流量
        var score = GetQueryString("score");
        var sock0 ,sock1,sock2;
        sock0 = GetQueryString("sock0");
        sock1 =  GetQueryString("sock1");
        sock2 =  GetQueryString("sock2");

        if (sock0 == 1){
            sock0 = 1;
        }
        if (sock1 == 1){
            sock1 = 1;
        }
        if (sock2 == 1){
            sock2 = 1;
        }

//        alert(GetQueryString("sock0"));
//        alert(GetQueryString("sock1"));
        alert(GetQueryString("sock2"));

        //  保存分数
        $.ajax({
            type: "GET",
            url: "/Christmas/saveScore",
            data: "score="+score+"&scoreDetail="+sock0+sock1+sock2,
            dataType: 'json',
            json: 'callback',
            success: function (data) {

//               获取 shareUrl
            }
        });



        if (score == 3){
            $(".getallprize").css("display","block");

        } else  {
            $(".weizj").css("display","block");
		}

        $(".share").tap(function () {
            $(".shareGuide").css("display","block");
        });

        $(".shareGuide").tap(function () {
            $(".shareGuide").css("display","none");
        });

        $(".myenter").click(function () {
            var phoneNum=document.getElementById("phoneNum").value;
            alert(phoneNum);

            //保存用户中奖信息接口
            $.ajax({
                type: "GET",
                url: "/Christmas/saveWinner",
                data: "PhoneNo="+phoneNum+"winType=1",
                dataType: 'json',
                json: 'callback',
                success: function (data) {
                    alert("提交成功,稍后为您兑奖!")
                }
            });
        })

    });
</script>


</html>